<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});

Route::get('coaches', 'Api\CoachController@list');
Route::get('coaches/{coach}', 'Api\CoachController@item');
Route::get('videos', 'Api\VideoController@list');
Route::get('videos/{video}', 'Api\VideoController@item');
Route::get('posts', 'Api\PostController@list');
Route::get('posts/{post}', 'Api\PostController@item');
Route::get('posts/{post}/comments', 'Api\PostController@comments');

// 活动列表、报名列表、详情、报名活动
Route::get('activities', 'Api\ActivityController@index');
Route::get('activities/{id}', 'Api\ActivityController@detail');
Route::get('activities/{id}/signup-list', 'Api\ActivityController@signuplist');
Route::get('activities/{id}/signup', 'Api\ActivityController@signup');

// 课程列表、课程详情、报名列表、报名课程
Route::get('courses', 'Api\CourseController@index');
Route::get('courses/{id}', 'Api\CourseController@detail');
Route::get('courses/{id}/signup', 'Api\CourseController@signup');
Route::get('courses/{id}/signup-list', 'Api\CourseController@signuplist');

// 俱乐部列表、详情
Route::get('clubs', 'Api\ClubController@index');
Route::get('clubs/{id}', 'Api\ClubController@detail');

// 比赛列表、详情、搜索比赛
Route::get('competitions', 'Api\CompetitionController@index');
Route::get('competitions/{id}', 'Api\CompetitionController@detail');
